package com.yilin.tms.core.entity.order.payment;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.entity.capital.TradeRecord;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "order_settlement_cost")
@TableName(value = "order_settlement_cost")
public class OrderSettlementCost extends BaseDataEntity {

    /**
     * 付款状态
     */
    public enum PayStatus {
        verify(0, "审核中"),//付款审批中
        fail(1, "失败"),//付款审批失败，不允许付款
        approved(2, "已审批，等待付款"),//付款审批完成
        wait(3, "等待中"),//付款已通过，即将付款
        success(4, "付款成功");//付款完成

        @EnumValue
        public Integer index;
        public String name;

        PayStatus(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    //车主
    @Column(name = "trucker_organize_id")
    private String truckerOrganizeId;//
    @Column(name = "trucker_organize_name")
    private String truckerOrganizeName;//
    @Column(name = "trucker_user_name")
    private String truckerUserName;//
    @Column(name = "truck_no")
    private String truckNo;//
    //订单
    @Column(name = "transit_order_id")
    private String transitOrderId;//运单ID
    @Column(name = "transport_no")
    private String transportNo;//运单号
    @Column(name = "clear_order_id")
    private String clearOrderId;//清算单ID

    @Column(name = "actual_transport_cost")
    private Double actualTransportCost; //运输费 货主支付给平台的运输费部分
    @Column(name = "additional_cost")
    private Double additionalCost = 0D; //应得附加费

    @Column(name = "trucker_fee_cost")
    private Double truckerFeeCost; //平台服务费--司机
    @Column(name = "diff_indemnity_cost")
    private Double diffIndemnityCost; //磅差/货损 赔偿--司机
    @Column(name = "oil_cost")
    private Double oilCost;//油费--司机
    @Column(name = "etc_toll_cost")
    private Double etcTollCost;//ETC过路费--司机
    @Column(name = "added_tax_cost")
    private Double addedTaxCost;  //增值税
    @Column(name = "city_tax_cost")
    private Double cityTaxCost;//城建税 基于增值税
    @Column(name = "local_edu_tax_cost")
    private Double localEduTaxCost;//地方教育税 基于增值税
    @Column(name = "edu_add_tax_cost")
    private Double eduAddTaxCost;//教育附加税 基于增值税
    @Column(name = "income_tax_cost")
    private Double incomeTaxCost;//个人所得税
    @Column(name = "trucker_tax_cost")
    private Double truckerTaxCost; //TODO:实际扣除司机总税费合计

    //    @Column(name = "technical_fee_cost")
//    private Double technicalFeeCost; //TODO:通道服务费
    @Column(name = "technical_fee_cost")
    private Double technicalFeeCost; //TODO:通道服务费 恢复司机
    //实际支付费用合计
    @Column(name = "settlement_cost")
    private Double settlementCost;

    // 基本支付数据
    @Column(name = "pre_payment_no")
    private String prePaymentNo;//预付单号
    @Column(name = "pay_status")
    private PayStatus payStatus;//支付状态
    @Column(name = "trade_no")
    private String tradeNo;//支付单号(平台流水号)
    @Column(name = "pay_remark")
    private String payRemark;//付款说明
    // 付款操作人
    @Column(name = "initiate_user_id")
    private String initiateUserId;//付款发起人 create:zjy 2022/8/3
    @Column(name = "initiate_user_name")
    private String initiateUserName;//付款发起人名称 create:zjy 2022/8/3
    @Column(name = "opt_user_id")
    private String optUserId;//付款操作人ID create:zjy 2022/8/3
    @Column(name = "opt_user_name")
    private String optUserName;//付款操作人名称 create:zjy 2022/8/3
    // 第三方支付数据
    @Column(name = "payment_type_name")
    private String paymentTypeName;//支付银行/平台名称
    @Column(name = "bank_flow_no")
    private String bankFlowNo;//银行流水号（银行/第三方)
    @Column(name = "payment_capital_account")
    private String paymentCapitalAccount;//付款资金账号/卡号/微信ID/支付宝ID 等
    @Column(name = "income_capital_account")
    private String incomeCapitalAccount;//收款资金账号/卡号/微信ID/支付宝ID 等
    @Column(name = "payment_safe_code")
    private String paymentSafeCode;//新增安全码，用于通知结果时验证支付结果安全
    // 时间线
    @Column(name = "pay_create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payCreateTime;
    @Column(name = "pay_complete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payCompleteTime;

    public Double getTechnicalFeeCost() {
        return technicalFeeCost;
    }

    public void setTechnicalFeeCost(Double technicalFeeCost) {
        this.technicalFeeCost = technicalFeeCost;
    }

    public String getTransportNo() {
        return transportNo;
    }

    public void setTransportNo(String transportNo) {
        this.transportNo = transportNo;
    }

    public Double getAdditionalCost() {
        return additionalCost;
    }

    public void setAdditionalCost(Double additionalCost) {
        this.additionalCost = additionalCost;
    }

    public Double getActualTransportCost() {
        return actualTransportCost;
    }

    public void setActualTransportCost(Double actualTransportCost) {
        this.actualTransportCost = actualTransportCost;
    }

    public String getTruckerUserName() {
        return truckerUserName;
    }

    public void setTruckerUserName(String truckerUserName) {
        this.truckerUserName = truckerUserName;
    }

    public String getTruckNo() {
        return truckNo;
    }

    public void setTruckNo(String truckNo) {
        this.truckNo = truckNo;
    }

    public String getPrePaymentNo() {
        return prePaymentNo;
    }

    public void setPrePaymentNo(String prePaymentNo) {
        this.prePaymentNo = prePaymentNo;
    }

    public String getTruckerOrganizeId() {
        return truckerOrganizeId;
    }

    public void setTruckerOrganizeId(String truckerOrganizeId) {
        this.truckerOrganizeId = truckerOrganizeId;
    }

    public String getTruckerOrganizeName() {
        return truckerOrganizeName;
    }

    public void setTruckerOrganizeName(String truckerOrganizeName) {
        this.truckerOrganizeName = truckerOrganizeName;
    }

    public String getPaymentSafeCode() {
        return paymentSafeCode;
    }

    public void setPaymentSafeCode(String paymentSafeCode) {
        this.paymentSafeCode = paymentSafeCode;
    }

    public String getInitiateUserId() {
        return initiateUserId;
    }

    public void setInitiateUserId(String initiateUserId) {
        this.initiateUserId = initiateUserId;
    }

    public String getInitiateUserName() {
        return initiateUserName;
    }

    public void setInitiateUserName(String initiateUserName) {
        this.initiateUserName = initiateUserName;
    }

    public String getTransitOrderId() {
        return transitOrderId;
    }

    public void setTransitOrderId(String transitOrderId) {
        this.transitOrderId = transitOrderId;
    }

    public String getClearOrderId() {
        return clearOrderId;
    }

    public void setClearOrderId(String clearOrderId) {
        this.clearOrderId = clearOrderId;
    }

    public Double getTruckerFeeCost() {
        return truckerFeeCost;
    }

    public void setTruckerFeeCost(Double truckerFeeCost) {
        this.truckerFeeCost = truckerFeeCost;
    }

    public Double getDiffIndemnityCost() {
        return diffIndemnityCost;
    }

    public void setDiffIndemnityCost(Double diffIndemnityCost) {
        this.diffIndemnityCost = diffIndemnityCost;
    }

    public Double getOilCost() {
        return oilCost;
    }

    public void setOilCost(Double oilCost) {
        this.oilCost = oilCost;
    }

    public Double getEtcTollCost() {
        return etcTollCost;
    }

    public void setEtcTollCost(Double etcTollCost) {
        this.etcTollCost = etcTollCost;
    }

    public Double getAddedTaxCost() {
        return addedTaxCost;
    }

    public void setAddedTaxCost(Double addedTaxCost) {
        this.addedTaxCost = addedTaxCost;
    }

    public Double getCityTaxCost() {
        return cityTaxCost;
    }

    public void setCityTaxCost(Double cityTaxCost) {
        this.cityTaxCost = cityTaxCost;
    }

    public Double getLocalEduTaxCost() {
        return localEduTaxCost;
    }

    public void setLocalEduTaxCost(Double localEduTaxCost) {
        this.localEduTaxCost = localEduTaxCost;
    }

    public Double getEduAddTaxCost() {
        return eduAddTaxCost;
    }

    public void setEduAddTaxCost(Double eduAddTaxCost) {
        this.eduAddTaxCost = eduAddTaxCost;
    }

    public Double getIncomeTaxCost() {
        return incomeTaxCost;
    }

    public void setIncomeTaxCost(Double incomeTaxCost) {
        this.incomeTaxCost = incomeTaxCost;
    }

    public Double getTruckerTaxCost() {
        return truckerTaxCost;
    }

    public void setTruckerTaxCost(Double truckerTaxCost) {
        this.truckerTaxCost = truckerTaxCost;
    }

    public Double getSettlementCost() {
        return settlementCost;
    }

    public void setSettlementCost(Double settlementCost) {
        this.settlementCost = settlementCost;
    }

    public Date getPayCreateTime() {
        return payCreateTime;
    }

    public void setPayCreateTime(Date payCreateTime) {
        this.payCreateTime = payCreateTime;
    }

    public Date getPayCompleteTime() {
        return payCompleteTime;
    }

    public void setPayCompleteTime(Date payCompleteTime) {
        this.payCompleteTime = payCompleteTime;
    }

    public PayStatus getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(PayStatus payStatus) {
        this.payStatus = payStatus;
    }

    public String getPaymentTypeName() {
        return paymentTypeName;
    }

    public void setPaymentTypeName(String paymentTypeName) {
        this.paymentTypeName = paymentTypeName;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getPayRemark() {
        return payRemark;
    }

    public void setPayRemark(String payRemark) {
        this.payRemark = payRemark;
    }

    public String getOptUserId() {
        return optUserId;
    }

    public void setOptUserId(String optUserId) {
        this.optUserId = optUserId;
    }

    public String getOptUserName() {
        return optUserName;
    }

    public void setOptUserName(String optUserName) {
        this.optUserName = optUserName;
    }

    public String getBankFlowNo() {
        return bankFlowNo;
    }

    public void setBankFlowNo(String bankFlowNo) {
        this.bankFlowNo = bankFlowNo;
    }

    public String getPaymentCapitalAccount() {
        return paymentCapitalAccount;
    }

    public void setPaymentCapitalAccount(String paymentCapitalAccount) {
        this.paymentCapitalAccount = paymentCapitalAccount;
    }

    public String getIncomeCapitalAccount() {
        return incomeCapitalAccount;
    }

    public void setIncomeCapitalAccount(String incomeCapitalAccount) {
        this.incomeCapitalAccount = incomeCapitalAccount;
    }
}
